home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / tsbat27.zip / ZOO2ZIPH.BAT < prev   
DOS Batch File  |  1991-07-09  |  4KB  |  149 lines

  1. echo off
  2. rem
  3. rem Do not distribute ZOO2ZIPH.BAT separately from the rest of the package
  4. rem
  5.  
  6. rem If you get an "Out of environment space" message, increase your
  7. rem environment space by using shell configuration in config.sys:
  8. rem Example: shell=c:\bin\command.com /e:1024 /p
  9.  
  10. echo.
  11. echo ┌───────────────────────────────────────────────────────────────┐
  12. echo │ Convert and datestamp a single .zoo to .zip file with comment │
  13. echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, Tue 9-Jul-1991        │
  14. echo └───────────────────────────────────────────────────────────────┘
  15. if not "%1"=="" goto _continue
  16. echo.
  17. echo Usage: ZOO2ZIPH PackageName [/r(eplace the old .zoo with the new .zip)]
  18. echo Use no drive name! No extension!
  19. echo        ┌───────────────┐
  20. echo        │ NO WILDCARDS! │
  21. echo        └───────────────┘
  22. echo.
  23. echo When using for the first time:
  24. echo  1) Make zoo.exe, pkzip.exe, and scan.exe available (not provided)
  25. echo  2) Make a new directory e:\arczip\zip for converted files
  26. echo  3) Edit your own zip-file comment to e:\arczip\comment.txt (not provided)
  27. echo.
  28. echo Usually:
  29. echo  Place the .zoo file in directory e:\arczip\arc
  30. echo  And run normally
  31. echo.
  32. echo.
  33. echo.
  34. goto _out
  35.  
  36. :_continue
  37. rem Do the necessary program and comment files exist
  38. if not exist c:\tools\pkzip.exe goto _err1
  39. if not exist c:\box\boxtools\zoo.exe goto _err2
  40. if not exist e:\arczip\comment.txt goto _err3
  41. if not exist e:\arczip\zip\nul goto _err8
  42. if not exist c:\tools\scan.exe goto _err11
  43.  
  44. rem Build the names for source .zoo and target .zip files
  45. set _filea=e:\arczip\arc\%1.zoo
  46. set _filez=e:\arczip\zip\%1.zip
  47. if not exist %_filea% goto _err4
  48. if exist %_filez% goto _err5
  49. if not exist e:\arczip\tmp$$$\nul md e:\arczip\tmp$$$
  50. if exist e:\arczip\tmp$$$\*.* goto _err9
  51.  
  52. rem Test .zoo archive integrity
  53. c:\box\boxtools\zoo -test %_filea%
  54. if errorlevel==1 goto _err10
  55.  
  56. rem Unpack and check for viruses
  57. e:
  58. cd \arczip\tmp$$$
  59. c:\box\boxtools\zoo e %_filea% 
  60. c:\tools\scan /m /nomem /x e:\arczip\tmp$$$
  61. if errorlevel==1 goto _err12
  62.  
  63. rem Convert, use the date of the latest file, not the current date
  64. pkzip -a %_filez% e:\arczip\comment.txt
  65. pkzip -z %_filez% < e:\arczip\comment.txt
  66. pkzip -d %_filez% comment.txt
  67. pkzip -br:\ -u -m -o %_filez% e:\arczip\tmp$$$\*.*
  68. pkzip -v %_filez%
  69. dir %_filez%
  70. cd \arczip
  71. rd e:\arczip\tmp$$$
  72.  
  73. rem State of the /r switch for replacing the old .zoo file
  74. if "%2"=="/r" goto _replace
  75. if "%2"=="/R" goto _replace
  76. goto _out
  77.  
  78. rem Replace the old .zoo file with the new .zip file
  79. :_replace
  80. echo.
  81. echo To delete %_filea% press any key
  82. echo To cancel, use the Break key now
  83. pause >nul
  84. if not exist %_filez% goto _err6
  85. if exist %_filea% del %_filea%
  86. if exist %_filea% goto _err7
  87. echo.
  88. echo File %_filea% deleted
  89. goto _out
  90.  
  91. :_err1
  92. Echo File c:\tools\pkzip.exe not found
  93. goto _out
  94.  
  95. :_err2
  96. Echo File c:\box\boxtools\zoo.exe not found
  97. goto _out
  98.  
  99. :_err3
  100. Echo File e:\arczip\comment.txt not found
  101. goto _out
  102.  
  103. :_err4
  104. Echo File %_filea% not found
  105. echo.
  106. echo Usage: ZOO2ZIPH PackageName [/r(eplace the old .zoo with the new .zip)]
  107. echo Use no drive name! No extension!
  108. echo        ┌───────────────┐
  109. echo        │ NO WILDCARDS! │
  110. echo        └───────────────┘
  111. goto _out
  112.  
  113. :_err5
  114. Echo File %_filez% already exists
  115. goto _out
  116.  
  117. :_err6
  118. Echo ZOO2ZIPH aborted: File %_filez% not found
  119. goto _out
  120.  
  121. :_err7
  122. Echo ZOO2ZIPH aborted: Disk or file %_filea% is readonly
  123. goto _out
  124.  
  125. :_err8
  126. Echo Error: Directory e:\arczip\zip does not exist
  127. goto _out
  128.  
  129. :_err9
  130. Echo Error: Directory e:\arczip\tmp$$$ is not empty
  131. goto _out
  132.  
  133. :_err10
  134. Echo ZOO2ZIPH aborted: Error in %_filea%
  135. goto _out
  136.  
  137. :_err11
  138. Echo File c:\tools\scan.exe not found
  139. goto _out
  140.  
  141. :_err12
  142. Echo ZOO2ZIPH aborted: Scan reports problems in c:\arczip\tmp$$$
  143. goto _out
  144.  
  145. :_out
  146. set _filea=
  147. set _filez=
  148. echo on
  149.